<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/js/jquery-3.2.1.min.js"></script>
    <script>
        $(function () {
            $(".anyone").fadeIn(1500);
        })
    </script>
    <link rel="stylesheet" href="/css/login.css">
</head>
<body>
<div class="anyone">
    <div class="dr" id="dr">
        <form action="success.html" th:action="@{/testLogin}" method="post" onsubmit="return loginJs()">
            <div class="inNum">
                <img src="/img/用户.png" alt="">
                <input type="text" name="loginname" placeholder="请输入编号">
            </div>
            <div class="inNum">
                <img src="/img/密码.png" alt="password">
                <input type="password" name="password" placeholder="请输入密码">
            </div>
            <div class="inNum">
                <button>登&nbsp录
                    <img src="/img/登入.png" alt="" style="position:relative;top: 6px;left: 5px;">
                </button>
            </div>
        </form>
    </div>
</div>
<script>
    var uName = document.getElementById("userName");
    var uPw = document.getElementById("uPw");
    function loginJs() {
        if(uName.value == '' || uName.value == null){
            alert("请输入用户名");
            return false;
        }else if(uPw.value == '' || uPw.value == null){
            alert("请输入密码");
            return false;
        }
    }
</script>
</body>
</html>